package com.kabuda.blog.config;

import net.sf.jsqlparser.expression.operators.arithmetic.Concat;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.util.ArrayList;

/**
 * @author kabuda
 * @create 2023-01-16 19:55
 */
@Configuration
@EnableSwagger2
public class SwaggerConfig {
    @Bean
    public Docket docket(){
        Docket docket = new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(apiInfo())
                .select().apis(RequestHandlerSelectors.basePackage("com.kabuda.blog.controller")).build()
                ;
        return docket;

    }

    public ApiInfo apiInfo() {
       ApiInfo apiInfo = new ApiInfo("卡布达博客在线文档", "在线博客", "1.0", "http://gitee.com/dabuka",  new Contact("达布卡", "http://gitee.com/dabuka", "1510418890qq.com"), "Apache 2.0", "http://www.apache.org/licenses/LICENSE-2.0", new ArrayList());
       return apiInfo;
    }

}
